The BIOS command, when complete, returns control to the requesting program at
the next instruction after the software interrupt. A return code is set in the
Carry Flag (CF) and a status code is placed in register AH for examination by
the requesting program. The expected return codes placed in the Carry Flag are
shown below.
CF Contents at Return Return Code
CF=1 Status is non-zero. Unusual condition or error
detected.
CF=0 Status is zero. Normal command completion occurred.
AH Contents at Return Status of Operation
AH = 00H No error:The operation completed successfully.
AH = 01H Invalid Function Request: The operation code or an
associated parameter provided by the Interrupt 13
operation was not valid.
AH = 02H Unable to Read Address Mark: One of the following
additional sense codes (SCSI ASC) was presented in the
sense information returned by the REQUEST SENSE
command:
12H (No AM Found on Data Field)
21H (Illegal Logical Block Address)
AH = 03H Write Protect Error: Returned SCSI ASC was:
27H (Data Protect)
AH = 04H Read Error:Returned SCSI ASC during a read operation
was:
14H (No Record Found)
16H (Data Sync Error)
AH = 10H Uncorrectable ECC Error in Data: Returned SCSI ASC
during a read operation was:
10H (ID ECC Error)
11H (Unrecovered Read Error)
AH = 11H ECC Corrected Data Error:Returned SCSI ASC during a
read operation was:
17H (Recovered Read Error w/o ECC)
18H (Recovered Read Error w/ ECC)
AH = 20H General Controller Failure:A host adapter detected
failure occurred or one of the following SCSI ASC's
was returned:
01H 08H 40H 46H
03H 09H 41H 47H
05H 1BH 42H 48H
06H 1CH 43H 49H
07H 1DH 44H
AH = 40H Seek Operation Failed: Returned SCSI ASC was:
15H (Seek Positioning Error)
02H (No Seek Complete)
AH = 80H Selection Time-out: A host adapter does not respond to
BIOS.
AH = AAH Device Not Ready:Returned SCSI ASC was:
04H (LUN Not Ready)
28H (Unit Attention, Ready)
29H (Unit Attention, Power On)
2AH (Unit Attention, Mode Select Change)
AH = BBH Unknown Target Sense Error Occurred: A SCSI ASC other
than those specified above was returned from the
selected SCSI device.
AH = CCH Write Error: Not Returned
H = FFH Sense Operation Failed:BIOS unable to retrieve sense
information from target.
6.3 BIOS DISK COMMANDS
The commands that can be accepted from the operating system by the BIOS include
all those commands required for normal DOS operation, for booting of the DOS
operating system, for the booting of other operating systems, and for basic
maintenance and verification of normal disk operation. The command set is
summarized in the following table and each command is described in more detail
in the sections following.
AH Register Meaning
00 H Reset Disk System
01 H Read Status of Last Operation
02 H Read Desired Sectors into Memory
03 H Write Desired Sectors from Memory
04 H Verify Desired Sectors
06 H Identify SCSI Devices
08 H Read Drive Parameters
09 H Initialize Drive Pair Characteristics
0C H Seek
0D H Alternate Disk Reset
10 H Test Drive Ready
11 H Recalibrate
15 H Read DASD Type
The Format commands (AH = 05, 06, 07, and 1AH) are not supported by the AHA-
1540A/1542A BIOS. The format operation is performed under a special format
utility installed in ROM and initiated through the DEBUG program.
The Diagnostic Reserved commands (AH = 0A, 0B, 0E, 0F, 12, and 14H) are not
supported by the AHA-1540A/1542A BIOS.
The Park Heads command (AH = 19H) is not supported by the AHA-1540A/1542A
BIOS.
The Reserved for Diskette commands (AH = 16, 17, 18) and the commands from 1BH
up to FFH are not supported by the AHA-1540A/1542A BIOS. Any attempt to execute
any of these unsupported commands will be ended by the BIOS and an error code
of 01H (Invalid Function Request) will be returned in the AH register.
6.3.1 Reset Disk System
The BIOS is requested to reset the disk subsystem. A SCSI Reset operation is
performed on the SCSI bus if the bus is busy at the time the Reset Disk System
command is received by the host adapter. No other SCSI or host adapter activity
occurs. The BIOS command is then passed on to the standard BIOS so that any
internally installed hard disks and floppy disk devices can also be reset. If
the BIOS is operating concurrently with an internally installed hard disk, the
drive number is decremented by the AHA-1540A/1542A BIOS so that the standard
BIOS does not attempt to reset the drive that is not installed.
Input Parameters: AH = 00H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.2 Read Status of Last Operation
The status of the last operation performed to the specified disk is returned.
No SCSI activity occurs. The disk status is reset to zero.
Input Parameters: AH = 01H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.3 Read Desired Sectors Into Memory
The sectors requested by the parameters are read from the disk to the system memory. The SCSI command is executed as a READ (EXTENDED) command (SCSI Operation Code 28H). If the operation fails and an error is reported through the BIOS status byte, the operation should be retried one time. If a 11 Error (ECC Corrected Data Error) is returned, the data returned has been corrected and may be used with confidence.
Input Parameters: AH = 02H
DL = Drive Number (80H or 81H)
DH = Head
CH = Cylinder
CL = High Cylinder and Sector
AL = Number of Sectors to Read
ES:BX = Address of buffer area
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.4 Write Desired Sectors from Memory
The sectors requested by the parameters are written from the system memory to
the indicated disk. The SCSI command is executed as a WRITE (EXTENDED) command
(SCSI Operation Code 2AH). If the operation fails and an error is reported
through the BIOS status byte, the operation should be retried one time.
Input Parameters: AH = 03H
DL = Drive Number (80H or 81H)
DH = Head
CH = Cylinder
CL = High Cylinder and Sector
AL = Number of Sectors to Write
ES:BX = Address of buffer area
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.5 Verify Desired Sectors
The sectors defined by the parameters are verified to be correctly written on
the SCSI disk. The SCSI command is executed as a VERIFY command (SCSI Operation
2F) with the Byte Check bit set to zero. If the VERIFY command is not supported
by the selected disk, the Verify Desired Sectors will perform a SCSI READ
command (SCSI Operation Code 28H) and throw away the received data. If the
operation fails and an error is reported through the BIOS status byte, the
operation should be retried one time.
Input Parameters: AH = 04H
DL = Drive Number (80H or 81H)
DH = Head
CH = Cylinder
CL = High Cylinder and Sector
AL = Number of Sectors to Verify
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.6 Identify SCSI Devices
This is a special AHA-1540A/1542A BIOS call that is used to return the number
of the first supported SCSI drive. In the nonconcurrent case (2 SCSI drives),
the returned value will be 80H. If only one SCSI drive is installed, the
returned value will be 81H.
in the following table and each command is described in more detail
in the sections following.
AH Regi
Input Parameters: AH = 06H
Output Parameters: AH = Status of Operation
AL = First Drive Supported
80H Nonconcurrent operation
81H Concurrent operation
CF = Return Code
6.3.7 Read Drive Parameters
A SCSI READ CAPACITY command is used to determine the maximum logical block
of the selected drive. This information is then used to calculate the proper
number of cylinders to be returned to the host system. The number of heads
returned will always be 64 and the number of sectors per track will always
be 32. The number of drives returned will include both internally installed
drives and SCSI drives.
Input Parameters:AH = 08H
DL = Drive Number (80H or 81H)
Output Parameters:AH = Status of Operation
DL = Number of BIOS accessible drives attached (1 or 2)
DH = Maximum value for head number (3FH)
CH = Maximum value for Cylinder Range (Low Byte)
CL = Maximum value for Sector, High Cylinder Bits
Bits 7,6 High Order Cylinder Bits
Bits 5-0 Sector Number Maximum Value ( 20H)
CF = Return Code
6.3.8 Initialize Drive Pair Characteristics
This command performs no operation, since SCSI CCS drives are self
configuring.
Input Parameters: AH = 09H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.9 Seek
A seek to the logical block address defined by the physical parameters is
performed. The seek is performed using the SEEK (EXTENDED) command (SCSI
Operation 2BH). The SEEK commands are not mandatory CCS commands and are not
required for proper functioning of SCSI devices. If the addressed disk drive
reports an error indicating that the SEEK (EXTENDED) command is not
supported, the BIOS command will complete normally anyway. Since the seek
operation is performed automatically by a Read or a Write operation, there
is no need to generate a separate seek operation to access data.
Input Parameters: AH = 0CH
DL = Drive Number (80H or 81H)
DH = Head
CH = Cylinder
CL = High Cylinder. (Sector bits = 0)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.10 Alternate Disk Reset
The BIOS is requested to reset the disk subsystem. A SCSI Reset operation is performed on the SCSI bus if the bus is busy at the time the Reset
Input Parameters: AH = 00H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.11 Test Drive Ready
The BIOS command determines that the specified drive is available and ready
by executing a TEST UNIT READY command (SCSI Operation Code 00H) to the SCSI
device. The command may have to be executed a second time if a Unit
Attention condition was detected in the first execution of the TEST UNIT
READY.
Input Parameters: AH = 10H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.12 Recalibrate
The BIOS command transmits a REZER0 UNIT command (SCSI Operation Code 01H)
to the specified drive. Since the REZERO UNIT command is not a mandatory
command and is not required for proper functioning of the SCSI device, the
BIOS command will complete without indicating an error even if the SCSI
device indicates that the command is invalid.
Input Parameters: AH = 11H
DL = Drive Number (80H or 81H)
Output Parameters: AH = Status of Operation
CF = Return Code
6.3.13 Read DASD Type
The AHA-1540 BIOS executes this command by performing an INQUIRY (SCSI
Operation Code 12H) and a READ CAPACITY (SCSI Operation Code 25H) to the
selected SCSI drive. The INQUIRY command is used to verify that the device
is a Direct Access Storage Device. The READ CAPACITY is used to determine
the number of logical blocks available. A special return format is used to
obtain the required information.
Input Parameters: AH = 15H
DL = Drive Number (80H or 81H)
Output Parameters:AH = Status of Operation (Special Format)
00H Drive not present or DL invalid
01H Reserved
02H Reserved
03H Fixed Disk installed
CX,DX Number of 512 byte blocks available on disk
CF = Return Code
7.1 PC/AT BIOS
The PC/AT BIOS is provided to allow the user to use the AHA-1540A/1542A in
lieu of, or in addition to, a standard PC/AT hard disk controller. This
compatibility includes booting from a SCSI device. Hard disk requests are
sent to the BIOS via an INT 13 software interrupt. CPU register contents
specify the desired I/O function and associated parameters. The BIOS then
uses host adapter commands to emulate PC/AT functions. Again, since the
mailbox architecture is circumvented, PC/AT BIOS functions run in a single-
threaded mode.
The BIOS consists of three major functional components. These are:
1. Initialization Routine
2. System Boot Routine
3. Hard Disk I/O Routine
7.1.1 Initialization
The Initialization routine is called at power-up. This routine performs all
of the necessary initialization functions and will display the following
message if the system successfully recognizes the AHA-1540A/1542A BIOS.
ADAPTEC AHA-1540A/1542A HOST ADAPTER BIOS
COPYRIGHT 1987 ADAPTEC, INC.
ALL RIGHTS RESERVED.
If any subsequent initialization of the AHA-1540A/1542A fails, the following
message is displayed:
HOST ADAPTER NOT FOUND AT PORT 330H.
otherwise, the AHA-1540A/1542A BIOS chooses a course of action based upon
the number and types of hard disks already installed. In each case, the
number of hard disks already installed is displayed along with the ID
numbers of any SCSI devices that are successfully used by the BIOS.
Possible Messages:
HARD DISK #0 ALREADY INSTALLED.
HARD DISK #1 ALREADY INSTALLED.
HOST ADAPTER DIAGNOSTIC FAILURE.
SCSI DEVICE 0 : 0 NOT FOUND.
USING SCSI DEVICE 0 : 0 AS HARD DISK #0.
USING SCSI DEVICE 0 : 0 AS HARD DISK #1.
USING SCSI DEVICE 0 : 1 AS HARD DISK #1.
USING SCSI DEVICE 1 : 0 AS HARD DISK #1.
NOTE: No error message is displayed if a second SCSI drive is not available.
If the system reports an initial number of hard drives greater than 2, the
following message is displayed:
SYSTEM CONFIGURATION ERROR.
The AHA-1540A/1542A BIOS allows the use of 0, 1, or 2 hard disks on the SCSI
bus under DOS without a device driver.
If 2 hard disks are attached to an internal hard disk controller, and are
already recognized by the system, the BIOS does nothing. A device driver
will be needed to access SCSI devices.
If 1 hard disk is attached to an internal hard disk controller, and is
already recognized by the system, the BIOS attempts to assign the SCSI
device (Target : LUN) 0 : 0 as the second drive. (drive D:) If this is
unsuccessful, an initialization error is reported to the system.
If there are 0 hard disks attached to an internal controller, the BIOS
attempts to assign the first SCSI device (Target : LUN) 0 : 0 as the first
drive. (drive C:) If this is unsuccessful an initialization error is
reported to the system. If successful, the BIOS attempts to assign another
SCSI device as the second drive. (drive D:) Device 0 : 1 is tried first, and
if that fails, device 1 : 0 is tried. There is no initialization error
reported if a second drive is not available.
7.1.2 System Boot
System boot is invoked by execution of an Interrupt 19. No interception of
this interrupt is necessary, as the PC/AT BIOS manages the boot process.
When the boot procedure attempts to read the boot track from drive C:, the
AHA-154XA BIOS will respond if drive C: is a SCSI Drive. Only SCSI drive 0:0
can be assigned as a SCSI C: drive. Mother board BIOS's that use interrupt
13 to perform booting should boot normally from SCSI drives using the AHA-
154XA.
7.1.3 Hard Disk I/O
The BIOS enables up to two SCSI drives to be accessed via interrupt 13 as
described in Section 6.
7.2 XENIX/UNIX Drivers
SCO Xenix and Unix, Interactive Systems Unix, and Microport Unix all support
the AHA-1540A/1542A at the time of this publication. Please consult with
these Operating System companies for more information on their products.
7.3 DOS Driver
An optional DOS Driver is available that enables the AHA-1540A/1542A to
access additional SCSI devices on the SCSI bus. When operating under DOS, a
device driver is needed to access more than two hard disks, tape devices or
other types of SCSI peripherals. In addition, DOS applications that use the
virtual memory mode of the 80386 processor require this driver. If you are
not running DOS programs that operate in the virtual 80386 mode, or if all
DOS operations will be confined to two SCSI disks or one internal and one
SCSI disk, a device driver is not needed because of the on-board BIOS. The
DOS driver is installed by creating a DOS configuration (CONFIG.SYS) file
that calls the device driver at boot time. Please refer to your DOS manual
for information on creating a CONFIG.SYS file. At initial system loading,
the AHA-1540A/1542A device driver will determine the number of hard disks
attached to the system. The device driver is normally only installed if one
of the following cases is true.
1) There are two internal hard disks and one or more SCSI disks.
2) There is one internal hard disk and two or more SCSI disks.
3) There are no internal hard disks and more than two SCSI disks.
The following table shows how hard disks in a system are addressed: